package com.example.Sorteando;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.ProgressBar;

import com.example.Sorteando.LoadingTask.LoadingTaskFinishedListener;

public class inicoactivity extends Activity implements LoadingTaskFinishedListener{
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // Show the splash screen
        setContentView(R.layout.inicioactivity);
        // Find the progress bar
        ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar1);
        // Start your loading
        new LoadingTask(progressBar, this).execute("http://tecksoft.com.br/"); // Pass in whatever you need a url is just an example we don't use it in this tutorial
    }
 
    // This is the callback for when your async task has finished
    @Override
    public void onTaskFinished() {
        completeSplash();
    }
 
    private void completeSplash(){
        startApp();
        finish(); // Don't forget to finish this Splash Activity so the user can't return to it!
    }
 
    private void startApp() {
        Intent intent = new Intent(inicoactivity.this, add_activity.class);
        startActivity(intent);
    }
 
}
